﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Media;

namespace SprintBoardMaker
{
    class TrelloColorToFGBrushConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (!(value is TrelloNet.Color))
                return Brushes.Black;

            switch ((TrelloNet.Color)value)
            {
                case TrelloNet.Color.Blue:
                case TrelloNet.Color.Green:
                case TrelloNet.Color.Orange:
                case TrelloNet.Color.Purple:
                case TrelloNet.Color.Red:
                    return Brushes.White;
                case TrelloNet.Color.Yellow:
                default:
                    return Brushes.Black;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            // Should not be needed
            throw new NotImplementedException();
        }
    }
}
